
# Bullet.rb
# Implements a DynamicObject to act as a Bullet object.

require 'game/DynamicObject'

class Bullet < DynamicObject

  def initialize(holder, options={})
    super(holder, options)
    window  = holder.window
    @image  = Gosu::Image.new(window, options['image'], false)
  end

  # The motion of the bullet when it's shoot by an object.
  def fire(angle, thrust)
    unless @shot
      @shot  = true
      @angle = angle
      @vel_x += Gosu::offset_x(@angle, thrust)
      @vel_y += Gosu::offset_y(@angle, thrust)
    end
  end

end
